<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>书单管理 </title>
<@fm.header />
<script type="text/javascript" src="/resources/js/common.js"></script>
<script type="text/javascript" src="/resources/js/book/bookGroup.js"></script>
</head>
<body class="cmp-list-body">
<div id="tb" style="padding:3px">
	<span>书单名称</span>
	<input id="sname" class="easyui-textbox" style="width: 155px;"/>
	<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch();">查询</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="toAdd();">新增</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="toEdit();">修改</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="toDel();">删除</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="showBookWin();">管理书籍</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="doRevert();">已支付金额清零</a>
    <span>清零时间</span>
    <input class="easyui-datetimebox" id="time" panelHeight="auto" style="line-height:20px;border:1px solid #ccc;width:155px;" data-options="required:true"/>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="updateTime();">更新时间</a>
</div>
<table id="tt" title="书单管理 " toolbar="#tb" rownumbers="true" idField="id"
	singleSelect="false" checkOnSelect="false" selectOnCheck="false" pagination="true" fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]">  
    <thead>
        <tr>
        	<th align="center" width="10%" field="id" checkBox="true"></th>
		    <th align="center" width="20%" field="name">书单</th>
		    <th align="center" width="15%" field="maxFail">最大付费失败次数</th>
		    <th align="center" width="10%" field="status" formatter="formatStatus">状态</th>
		    <th align="center" width="10%" field="createDate">创建时间</th>
		    <th align="center" width="10%" field="modifyDate">修改时间</th>
        </tr>
    </thead>   
</table>


<div id="addWin" class="easyui-window" title="书单管理|新增修改" closed="true" collapsible="false" 
minimizable="false"  maximizable="false" style="width:400px;height:300px" data-options="iconCls:'icon-save',modal:true">
     <div fit="true">
        <form id="addForm"  method="post" >
            <input type="hidden" id="idId"  name="id" />   
            <table>
		        <tr>
		             <td align="left">书单名称</td>
		             <td><input id="name" class="easyui-validatebox" data-options="required:true" name="name" style="width:200px"></input></td>
		        </tr>
		         <tr>
		             <td align="left">最大付费失败次数</td>
		             <td><input id="maxFail" class="easyui-validatebox" data-options="required:true" name="maxFail" style="width:200px"></input></td>
		        </tr>	
		        <tr>
		             <td align="left">状态</td>
		             <td>
		             <select class="easyui-combobox" id="status" name="status" panelHeight="auto" style="width:155px" data-options="required:true">
	                	<option value="1" selected>启用</option>
	                	<option value="0" >关闭</option>
		             </select>
		             </td>
		        </tr>	
           </table>
        </form>
        <div style="padding: 25px; text-align: center;">
            <a href="#" class="easyui-linkbutton" onclick="cancel();">取消</a>
            <a href="#" class="easyui-linkbutton"  onclick="save();">保存</a> 
        </div>
    </div>
</div>


<div id="selectWin" title="管理书籍" class="easyui-window" closed="true" collapsible="false" 
minimizable="false"  maximizable="false"  style="width:700px;height:530px">
    <div fit="true" class="easyui-layout"  style="overflow:scroll">
	
				 <table id="tbBook" class="easyui-datagrid" fitColumns="true" rownumbers="true" 
				 singleSelect="false" toolbar="#tb2" pagination="true" pageSize="15" pageList="[15,30,60,80,100]" >     
				     <thead>
					     <tr>
						    <th data-options="field:'id',checkbox:true"></th>
							<th align="left" width="30%" field="name">书名</th>
							<th align="left" width="10%" field="chapter">章节</th>
							<th align="left" width="10%" field="totalMoney">总限额(元)</th>
							<th align="left" width="10%" field="payMoney">已支付金额(元)</th>
							<th align="left" width="8%" field="failCount">总失败次数</th>
						 </tr>
				     </thead>   
				 </table>      
	</div>
</div>
	  
<div id="tb2" style="padding:3px">
	<span>书名:</span>    
	<input class="easyui-validatebox" style="width:100px" type="text" id="bookName" name="name" ></input>
	<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="searchBook();">查询</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="toAddBook();">新增</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="toEditBook();">修改</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteBook();">删除</a>
    <input type="hidden" id="bookGroupId" />
    <form id="uploadForm" method="post" enctype="multipart/form-data">
	<span>Excel文件</span><input type="file" name="excelFile" id="excelFile"></input>
    <a href="#" class="easyui-linkbutton" iconCls="icon-import" plain="true" onclick="doImport();">导入</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-export" plain="true" onclick="doExport();">导出</a> 
	</form>
	<form id="ff" method="post">
		<input type="hidden" id="ename" name="name">
		<input type="hidden" id="eGroupId" name="bookGroupId">
    </form>
</div>

<div id="showWin" class="easyui-window" title="书籍管理|excel查看" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:800px;height:510px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" style="overflow:scroll">
      <input type="hidden" id="counter" style="width: 155px;"/>
      <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="doUpdate();">更新入库</a>
    <table id="tbExcel" title="excel书籍管理 " rownumbers="true" singleSelect="false" pagination="true" fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]">  
    <thead>
        <tr>
		    <th align="center" width="20%" field="name">书名</th>
		    <th align="center" width="10%" field="chapter">章节</th>
		    <th align="center" width="10%" field="totalMoney">总金额</th>
        </tr>
    </thead>   
	</table>
	</div>
</div>

<div id="addBookWin" class="easyui-window" title="书籍管理|新增修改" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:450px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true">
        <form id="addBookForm"  method="post" >
            <input type="hidden" id="bookId" name="id"/>   
            <input type="hidden" id="groupId" name="bookGroupId"/>   
            <table>
		        <tr>
		             <td align="left">书名</td>
		             <td><input id="nameAdd" class="easyui-validatebox" data-options="required:true"  name="name" style="width:300px"></input></td>
		        </tr>	
		        <tr>
		             <td align="left">章节</td>
		             <td><input id="chapter" class="easyui-validatebox" data-options="required:true"  name="chapter" style="width:300px"></input></td>
		        </tr>
		        <tr>
		             <td align="left">总金额</td>
		             <td><input id="totalMoney" class="easyui-validatebox" data-options="required:true"  name="totalMoney" style="width:300px"></input></td>
		        </tr>
           </table>
        </form>
        <div style="padding: 25px; text-align: center;">
            <a href="#" class="easyui-linkbutton" onclick="cancelBook();">取消</a>
            <a href="#" class="easyui-linkbutton"  onclick="saveBook();">保存</a> 
        </div>
    </div>
</div>

</body>
</html>